home *** CD-ROM | disk | FTP | other *** search
- Path: news.compuserve.com!newsmaster
- From: steve <steve72@compuserve.com>
- Newsgroups: comp.lang.c++
- Subject: Re: C++ experts only
- Date: Sun, 31 Mar 1996 17:00:26 +0000
- Organization: martian onclave
- Message-ID: <315EBA2A.1EFC@compuserve.com>
- References: <4jhrb4$gk2@melon.myna.com> <4jkiua$pki@dfw-ixnews1.ix.netcom.com>
- NNTP-Posting-Host: ad32-153.compuserve.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (WinNT; I)
-
- John Lilley wrote:
- >
- > In article <4jhrb4$gk2@melon.myna.com>, ckhan@myna.com says...
- > >
- > >If you are such an expert, tell me why C++ is so great or not so great as
- > >compared to Structured C.
- >
- > Golly, such an attitude... But it DID get an answer...
- >
- > One could be glib and claim that there are NO disadvantages to C++ vs C because
- > C++ is a superset of C, but I don't that it what our dear friend is asking.
- >
- > One could also claim that C++ or any language is no better than the most
- > primitive assembler because they are all (within resource limits),
- > Turing-machine equivalent, but that is not the answer either, I fear.
- >
- > I assert that C++ is an improvement over C because:
- >
- > 1) It's type system and the safety guarantees therein are more complete and
- > allows one to write more reliable code.
- >
- > 2) It is more powerful and requires less typing and other such tedium to
- > express groupings of data and operations on data as classes instead of data
- > structures and functions.
- >
- > 3) C++ provides a uniform framework of object creation and destruction
- > regardless of the physical location (stack, heap or global). That uniform
- > treatment reduces the number of loose ends that crop up when using objects that
- > have various lifetimes.
- >
- > 4) Inheritance and the polymorphism supported by virtual methods are powerful
- > constructs that reduce the amount of tedium and/or type-violations that are
- > needed to express operations upon similar classes of objects.
- >
- > 5) Templates are great IMHO, because they allow one to write a type-safe
- > container once and use it for many objects (although at the possible expense of
- > code size).
- >
- > 6) Type-safe linkage reduces stupid errors due to mismatching of headers.
- >
- > 7) Overridable new/delete allow one to alter the behavior of memory allocation
- > in a systematic manner.
- >
- > 8) Method/function inlining is as efficient as macros (in most cases), but does
- > not suffer the semantic and syntactic nasty side-effects of macros.
- >
- > 9) Method inlining for access to data members is as efficient as a simple
- > pointer-indirection, but allows for access protection or future upgrades to the
- > access that are more complex than pointer-indirection.
- >
- > But this is all stuff you could have read in any intro to C++ book. I think
- > that the reasons are compelling -- why not go buy some books and check it out
- > for yourself?
- >
- > john lilley
-
-
- And of course, Microsoft uses it(c++).
- To think of the time I've saved with MFC and other objects
- I've used. I'd say C is surpassed by C++ with little question.
-
- steve
-